<template>
  <el-tooltip class="item" effect="dark" :content="params.isHigh ? `获取的时间:${params.awardTime}` : ''" placement="top" :disabled="!params.isHigh">
    <div class="tit-tag" :style="{top:params.tagTop,left:params.tagLeft,width: params.tagWidth,backgroundColor: params.isHigh ? params.lineBackgroundColor : 'rgb(223, 243, 218)',color: params.isHigh ? '#fff' : 'rgb(99, 148, 112)'}">
      <span>
        {{ params.name }}
      </span>
      <span
        class="line"
        :style="{width: params.lineWidth, right: params.lineRight,backgroundColor: params.lineBackgroundColor,marginTop: params.marginTop}"
      >
        <span class="circle" :style="{backgroundColor: params.circleBackgroundColor,right: params.circleRight || '-8px'}" />
      </span>
    </div>
  </el-tooltip>
</template>

<script>
export default {
  name: 'TitTag',
  props: {
    params: {
      type: Object,
      required: true
    }
  }
}
</script>

<style lang="scss" scoped>
  .tit-tag {
    &:hover{
      cursor: pointer;
    }
    position: absolute;
    display: inline-block;
    text-align: center;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
    background-color: rgb(223, 243, 218);
    .line{
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      height: 2px;
      .circle{
        position: absolute;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        right: -8px;
        top: 50%;
        border: 1px solid  #fff;
        transform: translateY(-50%);
      }
    }
  }
</style>
